<template>
  <div class="yang">
    <h2>home页面</h2>
    <button @click="go">跳转到钢铁侠页面-push</button>
     <button @click="go2">跳转到雷神页面-replace</button>
     <button @click="goBack">返回上一页-后退-go</button>
     <button @click="$router.back()">返回上一页-后退-back</button>
     <button @click="$router.forward()">返回上一页-前进-forward</button>
     <router-link to="/main">访问后台首页</router-link>
  </div>
</template>

<script>
export default {
  methods: {
    go() {
      this.$router.push('/movie/2')
    },
    go2() {
      this.$router.replace('/movie/1')
    },
    goBack() {
      this.$router.go(-1)
    }
  },
}
</script>

<style scoped>
 .yang {
   width: 100%;
   height: 200px;
   background-color: rgb(172, 255, 116);
 }
</style>